﻿@using Website.CRUDServices
@using Location = Website.Models.Domain.Location
@{
    this.ViewBag.Title = "Søgning - Matchmaking";
    this.Layout = "~/Views/_Shared/_Layout.cshtml";
    List<Profile> profiles = this.ViewData["Profiles"] as List<Profile> ?? new List<Profile>();
    List<Project> projects = this.ViewData["Projects"] as List<Project> ?? new List<Project>();
    List<Location> locations = this.ViewData["Locations"] as List<Location> ?? new List<Location>();
    List<Fund> funds = this.ViewData["Funds"] as List<Fund> ?? new List<Fund>();
    List<MatchmakingPartnerType> matchmakingPartnerTypes = this.ViewData["MatchmakingPartnerTypes"] as List<MatchmakingPartnerType> ?? new List<MatchmakingPartnerType>();
}

<h2>@ViewBag.Title</h2>

<script>
    $(function () {
        $('#Profiles').multiSelect();
        $('#Funds').multiSelect();
    });
</script>

@using (this.Html.BeginForm("MatchmakingSearchResult", "Reports"))
{
@* Tilføjer søge-partial *@
    @Html.Partial("~/Views/Reports/_SearchDefaultFields.cshtml", projects)

    <div class="formBullet">Profiler som skal indgå:</div>
    <div class="formEntry">
        <select name="Profiles" id="Profiles" multiple="multiple">
            @foreach (Profile prof in profiles)
            {
                <option value="@prof.ID">@prof.Name</option>
            }
        </select>
    </div>
    <label>
        <input type="checkbox" name="remoteArea" value="true">Yderområde</label><br />
    <label>
        <input type="checkbox" name="entrepeneur" value="true">Iværksætter</label>
    
    <div class="formBullet">Lokation:</div>
    <div class="formEntry">
        <select name="Location" id="Location">
            <option value="@Guid.Empty.ToString()" selected="selected"></option>
            @foreach (Location loc in locations)
            {
                <option value="@loc.ID">@loc.Name</option>
            }
        </select>
    </div>

    <div class="formBullet">Puljer og fonde som skal indgå:</div>
    <div class="formEntry">
        <select name="Funds" id="Funds" multiple="multiple">
            @foreach (Fund fund in funds)
            {
                <option value="@fund.ID">@fund.Name</option>
            }
        </select>
    </div>

    <div class="formBullet">Samarbejdspartner som skal indgå:</div>
    <div class="formEntry">
        <select name="MatchmakingPartnerType" id="MatchmakingPartnerType">
            <option value="@Guid.Empty.ToString()" selected="selected"></option>
            @foreach (MatchmakingPartnerType type in matchmakingPartnerTypes)
            {
                <option value="@type.ID">@type.Name</option>
            }
        </select>
    </div>

    <div class="buttonHolder">
        <input type="submit" value="Søg" />
    </div>
}